import { removeToken } from "@/utils/token"

const user = {
    namespaced: true,
    state: {
        token: '',
        userInfo: {
            username: '王xb',
            roles: ['admin'],
        },
        permissions: ['home', 'components', 'previewImage', 'error', '401'],
        btnPermissions:['aaa']
    },
    getters: {
        userInfo: state => state.userInfo,
        btnPermissions: state => state.btnPermissions,
    },
    mutations: {

    },

    actions: {
        // 退出系统
        LogOut({ commit }) {
            removeToken()
        }
    }
}

export default user
